<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button onclick="console.log('1')">点击</button>
    <script src="../js/01-JavaScript基础.js">
        //不要写JS代码，没有任何作用
    </script>
    <script type="text/javascript">
        // var a;//在JS中变量没有被赋值就是undefined
        // document.getElementById()
        // Array
        // "use strict"
        //var i = 10;与下面代码效果一致
        // i = 10;//在非严格模式下，会自动定义i变量，并且赋值
        // console.log(i);

        console.log(a);
        var a = 100;
        // a = 100;

        var b;

        for (var i = 0; i < 20; i++) {

        }
        console.log(i);

        console.log(window.a);
        console.log(window.b);
        console.log(window.i);
        var a = 101;
        console.log(a);

        //变量先定义再赋值，再使用
    </script>
</body>
</html>